﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class ScrollMain : MonoBehaviour {

	ScrollRect scroll;
	bool LerpV = true;

	// Use this for initialization
	void Start ()
	{
		scroll = gameObject.GetComponent<ScrollRect>();
		scroll.inertia = false;
	}

	void Update()
	{
		if(LerpV)
		{
			if (PlayerPrefs.GetInt ("TotalLevelDone")>2)
				scroll.verticalNormalizedPosition = (float)(PlayerPrefs.GetInt ("TotalLevelDone")-1) / 23;
			LerpV = false;
			scroll.inertia = true;
		}
	}

}